<!DOCTYPE html>

<html lang="en">
<head>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>课程</title>
</head>
<body>
 <%--
    List<Subject> datas=(List<Subject>)request.getAttribute("list");
    int total=(Integer)request.getAttribute("total");
    int pageNo=(Integer)request.getAttribute("pageNo");
 --%>
 <table border="1" cellspacing="0" cellpadding="0">
 <tr>
  <td>课程号</td><td>名称</td><td>学时</td><td>年级</td>
 </tr>
 <c:forEach items="${list }" var="sub" varStatus="s"> 
 <tr <c:if test="${s.index%2==0}">style='background-color:gray'</c:if> >
  <td>${sub.id }</td><td>${sub.subjectname }</td><td>${sub.classHour }</td><td>${sub.gradeid }</td>
 </tr>
 </c:forEach>
 
 </table>
<p>
	<a href="subjectServlet?pageNo=1">首页</a>
	 
	<c:if test="${pageNo>1}">
	<a href="subjectServlet?pageNo=${pageNo-1 }">上一页</a>
	</c:if>
 	<c:if test="${pageNo<total}">
	<a href="subjectServlet?pageNo=${pageNo+1}">下一页</a>
	 </c:if> 
	<a href="subjectServlet?pageNo=${total}">最后一页</a>
	 
</p>
</body>
</html>